package com.huawei.hwCloudJs.support.b;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

public abstract class c<T extends d> implements a<T> {
    private final List<b<T>> a = new ArrayList();

    /* JADX WARNING: inconsistent code. */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public void a(com.huawei.hwCloudJs.support.b.b<T> r3) {
        /*
        r2 = this;
        r1 = r2.a;
        monitor-enter(r1);
        if (r3 != 0) goto L_0x0007;
    L_0x0005:
        monitor-exit(r1);	 Catch:{ all -> 0x0016 }
    L_0x0006:
        return;
    L_0x0007:
        r0 = r2.a;	 Catch:{ all -> 0x0016 }
        r0 = r0.contains(r3);	 Catch:{ all -> 0x0016 }
        if (r0 != 0) goto L_0x0014;
    L_0x000f:
        r0 = r2.a;	 Catch:{ all -> 0x0016 }
        r0.add(r3);	 Catch:{ all -> 0x0016 }
    L_0x0014:
        monitor-exit(r1);	 Catch:{ all -> 0x0016 }
        goto L_0x0006;
    L_0x0016:
        r0 = move-exception;
        monitor-exit(r1);	 Catch:{ all -> 0x0016 }
        throw r0;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.huawei.hwCloudJs.support.b.c.a(com.huawei.hwCloudJs.support.b.b):void");
    }

    public void a(T t) {
        synchronized (this.a) {
            Collection arrayList = new ArrayList();
            for (b bVar : this.a) {
                if (!bVar.onReceive(t)) {
                    arrayList.add(bVar);
                }
            }
            if (arrayList.size() > 0) {
                this.a.removeAll(arrayList);
            }
        }
    }

    public void b(b<T> bVar) {
        synchronized (this.a) {
            this.a.remove(bVar);
        }
    }
}
